/**
 * 
 */
package by.bsu.scs.presentation.form;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.upload.FormFile;
import org.apache.struts.util.LabelValueBean;

/**
 * @author slavchoo
 * 
 */
public class CourseForm extends ActionForm {

	private static final long serialVersionUID = 1L;
	private String disciplineName;
	private FormFile  file;
	
	
	public String getDisciplineName() {
		return disciplineName;
	}

	public void setDisciplineName(String disciplineName) {
		this.disciplineName = disciplineName;
	}

	public FormFile  getFile() {
		return file;
	}

	public void setFile(FormFile file) {
		this.file = file;
	}
	
	/**
	 * @param mapping
	 * @param request
	 * 
	 * @return errors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		
		if(this.disciplineName == null || this.disciplineName.equalsIgnoreCase("")){
			errors.add("disciplineName", new ActionMessage("error.disciplineName"));
		}
		
		return errors;
	}
}
